<template>
	<view class="container">
		
		<view class="list-cell b-b "  hover-class="cell-hover" :hover-stay-time="50" v-for="(item, index) in st" :key="index"  @click="goShitiDetail(item.questionsid)">
			<text class="cell-tit">{{item.questionsname}}</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		
	</view>
</template>

<script>
	import subjectiveCaseApi from "@/api/subjectiveCase.js"
	let _this;
	export default {
		components: {
			
		},

		data() {
			return {
				query:{},
				page:1,
				pagenum:20,
				count:0,
				st:[]
			}
		},
		onLoad(query) {
			_this = this;
			_this.query = query
			_this.initData()
		},
		onReachBottom(e) {
			console.log(e)
			if(_this.count == _this.st.length){
				return
			}
			_this.page = _this.page+1
			_this.initData()
		},
		methods: {
			initData(){
				let {id} = _this.query
				subjectiveCaseApi.l_que_list_by_tea_page({id,page:_this.page,pagenum:_this.pagenum}).then(res=>{
					console.log(res)
					_this.count = res.data.count
					res.data.list = res.data.list || []
					_this.st = _this.st.concat(res.data.list)
				})
			},
			goShitiDetail(id){
				console.log(id)
				let teacode = _this.query.id
				uni.navigateTo({
					url:`/pages/subjectiveCase/detail?id=${id}&teacode=${teacode}`
				})
			},
			
		}
	}
</script>

<style lang='scss'>
	page{
		background: $page-color-base;
	}
	.list-cell{
		display:flex;
		align-items:baseline;
		padding: 20upx $page-row-spacing;
		line-height:60upx;
		position:relative;
		background: #fff;
		justify-content: center;
		&.log-out-btn{
			margin-top: 40upx;
			.cell-tit{
				color: $uni-color-primary;
				text-align: center;
				margin-right: 0;
			}
		}
		&.cell-hover{
			background:#fafafa;
		}
		&.b-b:after{
			left: 30upx;
		}
		&.m-t{
			margin-top: 16upx; 
		}
		.cell-more{
			align-self: baseline;
			font-size:$font-lg;
			color:$font-color-light;
			margin-left:10upx;
		}
		.cell-tit{
			flex: 1;
			font-size: $font-base + 2upx;
			color: $font-color-dark;
			margin-right:10upx;
		}
		.cell-tip{
			font-size: $font-base;
			color: $font-color-light;
		}
		switch{
			transform: translateX(16upx) scale(.84);
		}
	}
</style>
